473,421 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

css: vertical align text to a background image in a link

Hi,

I'm fairly new to using css, and have been using it to format a
vertical navigation bar on my website, producing a load of buttons on
top of each other, each with a (151 * 33 px) gif as the background.

I've customised the <a> tag as follows:
a.menu {
font-weight:bold;
display:block;
width:151px;
height:33px;
text-align:center;
text-decoration:none;
background-image:url('images/buttondark.gif');
}

then using this in my html as follows:

<body>

<a class="menu" href="button_one.htm" target="_top">
Button one </a>
<a class="menu" href="button_two.htm" target="_top"> Button two </a>
</body>
This is all cool except that the text isn't vertically aligned within
the gif - it sits in line with the top of the image. I've tired using
vertical-align:middle within the css but this doesn't make any
difference....

Help would be very greatfully received :D

Cheers

Chris

Nov 24 '05 #1
2 15539
Els
ch**********@yahoo.com wrote:
I'm fairly new to using css, and have been using it to format a
vertical navigation bar on my website, producing a load of buttons on
top of each other, each with a (151 * 33 px) gif as the background.

I've customised the <a> tag as follows:

a.menu {
font-weight:bold;
display:block;
width:151px;
height:33px;
text-align:center;
text-decoration:none;
background-image:url('images/buttondark.gif');
} .... <a class="menu" href="button_one.htm" target="_top"> Button one </a> .... This is all cool except that the text isn't vertically aligned within
the gif - it sits in line with the top of the image. I've tired using
vertical-align:middle within the css but this doesn't make any
difference....


line-height:33px;

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: The Buggles - Video Killed the Radio Star
Nov 24 '05 #2
Many thanks :D

Nov 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SK | last post by:
Hello, I am creating a web server control derived from datagrid for the first time. Now I would like to set the prefix of my control by default to SK instead of CC1. Is that possible? The other...
4
by: jereme.goblue | last post by:
The web page at http://www.rossowinspections.com/ has an issue with the left menu. The left menu has 7 links. One of the links doesn't work. Using Firefox 1.5 the Fees link isn't a clickable...
0
by: jereme.goblue | last post by:
The web page at http://www.rossowinspections.com/ has an issue with the left menu. The left menu has 7 links. One of the links doesn't work. Using Firefox 1.5 the Fees link isn't a clickable...
3
by: cbjewelz | last post by:
hey I've been suffering from several float problems. I want a Title on the left to be aligned vertically with several links on the right. However with my code the Title is lower than the links....
3
by: charchap | last post by:
hello. I'm experiencing problems with my css code (once again) working with Firefox and not working with IE 6 or 7 I have a problem with my head_logo_inner not too sure what's going on . Here is...
0
by: mjohnson0321 | last post by:
I am trying to incorporate a CSS drop-down menu into a site (suckerfish menu). The menu gets lost behind the content below it, but only on one of the drop downs (News). The error occurs on all of...
7
by: skoggins | last post by:
Hi all, On this page http://69.80.211.183/ in my FF 2.0.0.12 browser, the issue is the vertical white border I am trying to use to separate the right sidebar from the main content. The border...
3
by: Steve | last post by:
Hi All I have an asp.net 2.0 website with the following css file It uses Master pages and in Firefox 3.04 for windows only, 3 of the web pages don't display the Master page properly The...
8
by: azjudd | last post by:
Thank you in advance for your help on this one. I'm using named anchor tags on a FAQ page with questions listed at the top and answers below; a standard jump-to feature. However, anytime an anchor...
0
by: michelle5613 | last post by:
I am trying to create a dropdown menu using ONLY css. I am having a problem. I need to get the headings a different color and font than the subheadings. I need the heading to be white and have a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.